package com.badibadi.adapter;

import java.util.List;

import com.badibadi.infos.ClueTypeModel;
import com.badibadi.uniclubber.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class Popwindows_Adapter extends BaseAdapter {
	private List<ClueTypeModel> clueTypeModels;
	private Context context;

	public Popwindows_Adapter(List<ClueTypeModel> clueTypeModels,
			Context context) {
		this.clueTypeModels = clueTypeModels;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return clueTypeModels.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return clueTypeModels.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		LayoutInflater inflater = LayoutInflater.from(context);
		arg1 = inflater.inflate(
				R.layout.fragment_club_overview_popwindows_item, null);
		TextView popwindows_itmes_name = (TextView) arg1
				.findViewById(R.id.popwindows_itmes_name);
		TextView popwindows_itmes_num = (TextView) arg1
				.findViewById(R.id.popwindows_itmes_num);
		popwindows_itmes_name.setText(clueTypeModels.get(arg0).getName());
		popwindows_itmes_num.setText(clueTypeModels.get(arg0).getNum());
		return arg1;
	}

}
